
# $Id: Makefile 34 2007-07-09 06:03:33Z kf701.ye $

SRC=$(wildcard *.c)
OBJS=${SRC:%.c=%.o}
NAME=${SRC:%.c=%}

TARGET_MAJOR=libkf701.so.1
TARGET_MINOR=libkf701.so.1.0
TARGET_SO=libkf701.so
TARGET_A=libkf701.a

CFLAGS=-Wall -Os -Wstrict-prototypes -fPIC
LDFLAGS=-shared

all :  $(OBJS)
	make dll_lib
	make static_lib
	

dll_lib: $(OBJS)
	$(CC) ${LDFLAGS} -Wl,-soname,${TARGET_MAJOR} -o ${TARGET_MINOR} ${OBJS} 
	$(STRIP) ${TARGET_MINOR}
	$(LN) -s ${TARGET_MINOR} ${TARGET_MAJOR}
	$(LN) -s ${TARGET_MAJOR} ${TARGET_SO}

static_lib: $(OBJS)
	$(AR) rcs ${TARGET_A} ${OBJS}
	$(CHMOD) +x ${TARGET_A}


clean:
	rm -fr *.o core
